export default {

  // 总数量
  totalSize (state) {
    return state.todos.length
  },

  // 完成的数量
  completeSize (state) {
    return state.todos.reduce((pre, todo) => pre + (todo.completed ? 1 : 0), 0)
  },

  // 是否全部完成
  isCompleteAll (state, getters) {
    return state.todos.length === getters.completeSize && getters.completeSize>0
  }
}